package util;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import sun.net.httpserver.AuthFilter;

/**
 * @author NAME-L
 * @Description 资源映射路径
 * @className WebMvcConfigurer
 * @date 2022-03-21 14:49:03
 */
@Configuration
public class MyWebMvcConfigurer implements WebMvcConfigurer {


    /**
     * 图片文件上传响应外部访问地址
     * @param registry
     */
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        //addResourceHandler：指的是对外暴露的访问路径
        //addResourceLocations：指的是内部文件放置的目录
        registry.addResourceHandler("/api/file/**")
                .addResourceLocations("classpath:/static/")
                .addResourceLocations("file:/myProject/bootProject/flowerShop/web-flower-shop/admin_back/src/main/resources/static/uploadImg/");

    }
}
